 <meta charset="utf-8">
 <div class="card" id="biz_aIConfigCate_conatainer" style="padding-bottom: 0px;min-height: 500px;">
 
   
 <div class="card">
 	<div class="card-body">
 	<div class="row">
 	  <div class="col-md-12">
           
  		<div class="table-responsive">
            <table class="table mb-0">
                <thead>
                    <tr>
                        <th>#</th>
                        <th>名称</th>
                        <th>编码</th>
                    </tr>
                </thead>
                <tbody>
                    <tr  v-for="(item,index) in algorithmList">
                        <th scope="row">
							<input type="checkbox" class="listCheckbox"  
							  v-model="selectedAlg"
							  v-bind:value="item.code"
							  v-bind:checked="item.selected"
							  v-on:click="onChooseAlg(item.code)"  />
						</th>
                        <td>{{item.name}}</td>
                        <td>{{item.ndata.algCode}}</td>
                    </tr>
                   
                </tbody>
            </table>
        </div>
 	  </div>
 	</div>
 	</div>
 	</div>
 	<div class="form-group" style="padding-right: 15px;padding-left: 15px;">
                 <button type="button" class="btn btn-light" v-on:click="cancel">取消</button>
                 <button type="button" class="btn btn-info float-right"  v-on:click="edit">提交</button>
              </div>  
 </div>
<script>
var anewaz=new Vue({  
	  el: '#biz_aIConfigCate_conatainer', 
	  data:{
		  searchForm:{
			  name: null,
			  status: null
		  },
		  solutionId: null,
		  nowcate:{},
		  algorithmList:[],
		  selectedAlg:[],
		  itemList:[],
	      bus:new Vue()
	  },
	  mounted:function(){
		 var _this=this;
		 var param=zfesLayerEditDg.getLayerParam();
		 _this.solutionId=param.id;
		 _this.initAlgorithmList();
	  },

    methods: {
     	 initAlgorithmList: function(){
      		 var　_this=this;
      		 var url="/manager/solution/algorithm/loadSolutionAlgorithmSelectVo";
 		    zfesAjax.ajaxTodo(url, {solutionId:_this.solutionId}, function(data) {
 				_this.algorithmList=data.data.selectVo;
 				if(_this.algorithmList){
 					_this.algorithmList.forEach(function(item) {
 						if(item.selected==true){
 							_this.selectedAlg.push(item.code);
 						}
 					});
 				}
 				
 			});
     	 },
     	onChooseAlg: function(id){
     		 var　_this=this;
     		console.log(id);
     		console.log(_this.selectedAlg);
     	},
     	edit: function () {
	    		var _this=this;
	    		var url="/manager/solution/algorithm/setSolutionAlgorithms";
	    		zfesAjax.ajaxJson(url,{solutionId:_this.solutionId,algorithmIds:_this.selectedAlg}, function(data){
	    			alertSwal.successText(data.message);
	        		 layer.close(layer.index);
	        	 })
	    		
	    },
	    cancel: function(){
	    	 layer.close(layer.index);
	    }
	  
   	
   }

});

function showDetail(row){
	anewaz.showDetail(row);
}
</script>


